package com.bobo.myapplication.utils;

import android.util.Log;

import com.bobo.myapplication.BuildConfig;

/**
 * Created by ZJB on 2018/1/18.
 *
 * @ copyright: iwhere chengdu technology
 */

public class LogUtil {
    private boolean debug = BuildConfig.DEBUG;
    private static final String TAG = LogUtil.class.getSimpleName();


    public static StackTraceElement getTargetStackTraceElement(){
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        StringBuilder stringBuilder = new StringBuilder();
        for (StackTraceElement stackTraceElement : stackTrace) {
            String className = stackTraceElement.getClassName();
            String fileName = stackTraceElement.getFileName();
            String methodName = stackTraceElement.getMethodName();
            int lineNumber = stackTraceElement.getLineNumber();
            stringBuilder.append(className)
                    .append("->")
                    .append(fileName)
                    .append("->")
                    .append(methodName)
                    .append("->")
                    .append(lineNumber)
                    .append("\n");
            Log.e(TAG, stringBuilder.toString());
        }

        return null;
    }
}
